package io.xccit.main;

import com.formdev.flatlaf.FlatDarkLaf;
import com.formdev.flatlaf.FlatLightLaf;
import io.xccit.CustomWindowsListener;
import io.xccit.frame.LoginFrame;

import javax.swing.*;
import java.awt.*;

/**
 * @author CH_ywx
 * @date 2023/9/29
 * @description 启动类
 */
public class Main {
    public static void main(String[] args) {
        //TODO 窗口美化IDEA风格
        FlatLightLaf.install();
        try {
            UIManager.setLookAndFeel(new FlatDarkLaf());
            UIManager.put( "Button.arc", 20 );
            UIManager.put( "Component.arc", 20 );
            UIManager.put( "ProgressBar.arc", 20 );
            UIManager.put( "TextComponent.arc", 20 );
        } catch (Exception ex) {
            System.err.println("Failed to initialize LaF");
        }

        LoginFrame loginFrame = new LoginFrame();
        loginFrame.setBackground(Color.CYAN);
        loginFrame.addWindowListener(new CustomWindowsListener());
        loginFrame.setVisible(true);
    }
}
